#ifndef XSNPPEXTRACTOR_H_220911
#define XSNPPEXTRACTOR_H_220911
#include "xsn.h"

namespace xsn
{
	class XSN_API Extractor
	{
	public:		
		static std::string extract(ConstNodePtr node);
	protected:
		void format(ConstNodePtr node,std::string& src,size_t indent = 0);
		bool isMultiNode(ConstNodePtr node) const;
		Extractor(){};
		~Extractor(){};
	};
}

std::ostream& operator<<(std::ostream& os, xsn::ConstNodePtr node)
{
	os << xsn::Extractor::extract(node);
	return os;
}

std::ostream& operator<<(std::ostream& os, xsn::NodePtr node)
{
	os << xsn::Extractor::extract(node);
	return os;
}

std::istream& operator>>(std::istream &is, xsn::NodePtr node)
{
	std::string buf;
	is >> buf;
	node->set(buf);
	return is;
}

#endif
